package cn.ante.ymcc.feign;

import cn.ante.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class MediaFeignClientFallbackFactory implements FallbackFactory<MediaFeignClient> {

    @Override
    public MediaFeignClient create(Throwable throwable) {
        return new MediaFeignClient() {
            @Override
            public JSONResult getMediaByCourseId(Long courseId) {
                throwable.printStackTrace();
                return JSONResult.error("课程不可用！！！");
            }
        };
    }
}
